<template>
<div class="contain">
    <van-nav-bar
  title="请输入您的地址"
  left-text="返回"
  right-text="确定"
  left-arrow
  @click-left="onClickLeft"
  @click-right="onClickRight"
/>
<van-address-list
  v-model="chosenAddressId"
  :list="$store.state.cart.arr"
  :disabled-list="disabledList"
  disabled-text="以下地址超出配送范围"
  default-tag-text="默认"
  @add="onAdd"
  @edit="onEdit"
/>
</div>

</template>

<script>
import { Toast } from 'vant'
export default {
  data() {
    return {
      chosenAddressId: '1',
      disabledList: [
        {
          id: '3',
          name: '唐坤',
          tel: '18888888888',
          address: '人间天堂',
        },
      ],
    }
  },
  methods: {
    onAdd() {
      this.$router.push('/adress')
    },
    onEdit(item, index) {
      Toast('编辑地址:' + index)
    },
    onClickLeft() {
      this.$router.back()
    },
    onClickRight() {
      this.$router.push('/home')
    },
  },
}
</script>

<style lang="scss" scoped>

</style>
